package vn.fpt.fsoft.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * @author MinhNC7
 *
 */
@Entity
@Table(name = "PremiseVolunteering")
public class PremiseVolunteer {
	private int preVolunteerID;
	private int voluntContact;
	private String purpose;
	private String detail;
	private Date startDate;
	private Date endDate;
	private int nos;
	private PreJCPOffices preJCPOffices;
	private String status;
	@Id
	@GeneratedValue
	@Column(name="PreVolunteerID",nullable=false,unique=true)
	public int getPreVolunteerID() {
		return preVolunteerID;
	}
	public void setPreVolunteerID(int preVolunteerID) {
		this.preVolunteerID = preVolunteerID;
	}
	@Column(name="VolunteeringContact",nullable=true)
	public int getVoluntContact() {
		return voluntContact;
	}
	public void setVoluntContact(int voluntContact) {
		this.voluntContact = voluntContact;
	}
	@Column(name="Purpose",length=50,nullable=true)
	public String getPurpose() {
		return purpose;
	}
	public void setPurpose(String purpose) {
		this.purpose = purpose;
	}
	@Column(name="Details",length=200,nullable=true)
	public String getDetail() {
		return detail;
	}
	public void setDetail(String detail) {
		this.detail = detail;
	}
	
	@Temporal(TemporalType.TIMESTAMP.DATE)
	@Column(name="StartDate",nullable=true)
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	@Temporal(TemporalType.TIMESTAMP.DATE)
	@Column(name="EndDate",nullable=true)
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	@Column(name="Nos")
	public int getNos() {
		return nos;
	}
	public void setNos(int nos) {
		this.nos = nos;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="PremiseDetailID",nullable=true)
	public PreJCPOffices getPreJCPOffices() {
		return preJCPOffices;
	}
	public void setPreJCPOffices(PreJCPOffices preJCPOffices) {
		this.preJCPOffices = preJCPOffices;
	}
	@Column(name="Status",nullable=true,length=3)
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public PremiseVolunteer(int preVolunteerID, int voluntContact,
			String purpose, String detail, Date startDate, Date endDate,
			int nos, PreJCPOffices preJCPOffices, String status) {
		super();
		this.preVolunteerID = preVolunteerID;
		this.voluntContact = voluntContact;
		this.purpose = purpose;
		this.detail = detail;
		this.startDate = startDate;
		this.endDate = endDate;
		this.nos = nos;
		this.preJCPOffices = preJCPOffices;
		this.status = status;
	}
	public PremiseVolunteer(){}
}
